package com.huluobo.mvvmdemo1903a.mvvm;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import com.huluobo.mvvmdemo1903a.R;
import com.huluobo.mvvmdemo1903a.databinding.ActivityDatabindingBinding;
import com.huluobo.mvvmdemo1903a.mvvm.model.User;

/**
 * Created by lc on 2021/11/22.
 */
public class DataBindingActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_databinding);
        String username = getIntent().getStringExtra("username");
        ActivityDatabindingBinding activityDatabindingBinding =
                DataBindingUtil.setContentView(this, R.layout.activity_databinding);
        User user = new User(username);
        activityDatabindingBinding.setUser(user);
    }
}
